<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 浅拷贝：指向的是堆内存的通风一个对象
         //深拷贝：指向堆内存的不同对象
        var arr = [1,2,3,4];
        var newArr = [...arr];
        newArr.push(5)
        console.log(arr);
         var arr = [1,2,3,4];
         var newArr = arr.slice(0,);
         arr.push(5)
         console.log(newArr);
        var arr = [1,2,3,4]
        var newArr = [].concat(arr)
        newArr.push(5);
        console.log(arr);
    </script>
</body>
</html>